import { services } from '@/config'

export const tableOption = {
  column: [
    {
      prop: 'id',
      span: 12,
      type: 'input',
      label: '主键Id',
      display: false,
      hide: true
    },
    {
      prop: 'unid',
      span: 12,
      type: 'input',
      label: '唯一编码',
      rules: [],
      display: false,
      required: false,
      hide: true
    },
    {
      prop: 'authorId',
      span: 12,
      type: 'input',
      label: '作者ID',
      display: false,
      hide: true
    },
    {
      prop: 'authorName',
      span: 12,
      type: 'input',
      label: '作者姓名',
      display: false,
      hide: true
    },
    {
      prop: 'deptId',
      span: 12,
      type: 'input',
      label: '单位、部门ID',
      display: false,
      hide: true
    },
    {
      prop: 'deptFullname',
      span: 12,
      type: 'input',
      label: '作者单位全编码',
      display: false,
      hide: true
    },
    {
      prop: 'createBy',
      span: 12,
      type: 'input',
      label: '创建人',
      display: false,
      hide: true
    },
    {
      prop: 'createTime',
      span: 12,
      type: 'input',
      label: '创建时间',
      display: false,
      hide: true
    },
    {
      label: '所属父区域',
      type: 'tree',
      prop: 'parentId',
      props: { label: 'name', value: 'id' },
      span: 12,
      hide: true,
      dicUrl: `${services.spaceService}fyroomregional/tree`,
      dicMethod: 'get',
      dataType: 'input',
      rules: [
        {
          required: false,
          message: '请选择父区域',
          trigger: 'change'
        }
      ]
    },
    {
      prop: 'parentName',
      span: 12,
      type: 'input',
      width: 110,
      label: '所属父区域名称',
      display: false
    },
    {
      prop: 'ordernumber',
      span: 12,
      type: 'number',
      label: '排序号',
      controls: true,
      addDisplay: false,
      maxlength: 7,
      rules: [
        {
          message: '排序号必须填写',
          required: true
        }
      ]
    },
    {
      prop: 'name',
      span: 12,
      type: 'input',
      label: '区域名称',
      search: true,
      searchLabelWidth: 90,
      width: 160,
      rules: [
        {
          message: '区域名称必须填写',
          required: true
        }
      ],
      required: true,
      maxlength: 255
    },
    {
      prop: 'code',
      span: 12,
      type: 'input',
      label: '区域编码',
      editDisabled: true,
      addDisplay: false,
      width: 140,
      maxlength: 255
    },
    {
      prop: 'x',
      span: 12,
      type: 'input',
      label: '经度',
      maxlength: 15
    },
    {
      prop: 'y',
      span: 12,
      type: 'input',
      label: '纬度',
      maxlength: 15
    },
    {
      prop: 'coverArea',
      span: 12,
      type: 'input',
      label: '占地面积',
      rules: [],
      maxlength: 10
    },
    {
      prop: 'floorage',
      span: 12,
      type: 'input',
      label: '建筑面积',
      maxlength: 10
    },
    {
      prop: 'address',
      span: 12,
      type: 'input',
      label: '区域地址',
      searchLabelWidth: 90,
      width: 140,
      search: true,
      maxlength: 255
    },
    {
      prop: 'postalCode',
      span: 12,
      type: 'input',
      label: '地址编号'
    },
    {
      prop: 'houseNumber',
      span: 12,
      type: 'input',
      label: '门牌号',
      maxlength: 16
    },
    {
      prop: 'landId',
      span: 12,
      type: 'tree',
      label: '所属土地',
      dicUrl: `${services.spaceService}fyroomregional/landTree`,
      props: { label: 'name', value: 'id' },
      dicMethod: 'get',
      rules: [],
      hide: true
    },
    {
      prop: 'landName',
      span: 12,
      type: 'input',
      label: '所属土地名称',
      width: 140,
      display: false,
      hide: false
    },
    {
      prop: 'assetNumber',
      span: 12,
      type: 'input',
      label: '资产编码',
      display: false,
      hide: true
    },
    {
      prop: 'mgmtUnitName',
      span: 24,
      type: 'input',
      label: '管理单位名称',
      rules: [],
      display: false,
      maxlength: 255
    },
    {
      prop: 'mgmtUnitId',
      span: 24,
      type: 'tree',
      label: '管理单位',
      rules: [],
      required: false,
      hide: true,
      dicUrl: `${services.adminService}dept/tree`,
      parent: true,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' }
    },
    {
      prop: 'remarks',
      span: 24,
      type: 'textarea',
      label: '备注',
      display: true,
      width: 200,
      maxlength: 1500
    },
    {
      prop: 'fullcode',
      span: 12,
      type: 'input',
      label: '区域全编码',
      maxlength: 255,
      display: false,
      hide: true
    },
    {
      prop: 'dataCode',
      span: 12,
      type: 'input',
      label: '数据权限编码，从土地、区域、楼栋等编码检索',
      rules: [],
      display: false,
      hide: true
    },

    {
      prop: 'updateBy',
      span: 12,
      type: 'input',
      label: '修改人',
      display: false,
      hide: true
    },
    {
      prop: 'updateTime',
      span: 12,
      type: 'input',
      label: '修改时间',
      display: false,
      hide: true
    },
    {
      prop: 'delFlag',
      span: 12,
      type: 'input',
      label: '删除标记,1:已删除,0:正常',
      display: false,
      hide: true
    },
    {
      prop: 'level',
      span: 12,
      type: 'input',
      label: '层级',
      display: false,
      hide: true
    },
    /*,
    {
      type: 'upload',
      label: '上传附件',
      span: 24,
      display: true,
      hide: true,
      showFileList: false,
      multiple: true,
      limit: 10,
      canvasOption: {},
      propsHttp: {
        res: 'data'
      },
      prop: 'imgUrlType',
      action: "/admin/sys-file/upload",
      tip: '上传同步至文件服务器',
      data: {model: 'regional', classify: 'regional'}
    } */
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true
    }
  ],
  labelPosition: 'left',
  labelSuffix: '：',
  labelWidth: 120,
  gutter: 0,
  menuBtn: true,
  submitBtn: true,
  submitText: '提交',
  emptyBtn: true,
  emptyText: '清空',
  menuPosition: 'center',
  align: 'center',
  index: true,
  border: true,
  stripe: true,
  menuAlign: 'center',
  indexLabel: '序号',
  searchMenuSpan: 12,
  viewBtn: true
}
